using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VSSDKAssist.Assets.CustomPages;
using Microsoft.Practices.WizardFramework;
using Microsoft.VisualStudio.Shell;
using VSSDKAssist.Recipes.Common.Editors;
using VSSDKAssist.Recipes.Common.Converters;

namespace VSSDKAssist.Recipes.CreateVSToolWindow
{
	/// <summary>
	/// Custom page for CreateVSToolWindow recipe
	/// </summary>
	public partial class CreateVSToolWindowCP4 : WizardPageBase
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="CreateVSToolWindowCP4"/> class.
		/// </summary>
		public CreateVSToolWindowCP4()
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="CreateVSToolWindowCP4"/> class.
		/// </summary>
		/// <param name="wizard">The <see cref="T:Microsoft.Practices.WizardFramework.WizardForm"/>that will host the new page.</param>
		public CreateVSToolWindowCP4(WizardForm wizard)
			: base(wizard)
		{
			InitializeComponent();
		}

		/// <summary>
		/// Gets or sets a value indicating whether [subscribe to window frame events].
		/// </summary>
		/// <value>
		/// 	<c>true</c> if [subscribe to window frame events]; otherwise, <c>false</c>.
		/// </value>
		[RecipeArgument]
		public bool SubscribeToWindowFrameEvents
		{
			get { return chkSubscribeToWindowFrameEvents.Checked; }
			set
			{
				chkSubscribeToWindowFrameEvents.Checked = value;
			}
		}

		/// <summary>
		/// Gets or sets a value indicating whether [selection tracking support].
		/// </summary>
		/// <value>
		/// 	<c>true</c> if [selection tracking support]; otherwise, <c>false</c>.
		/// </value>
		[RecipeArgument]
		public bool SelectionTrackingSupport
		{
			get { return chkSelectionTrackingSupport.Checked; }
			set
			{
				chkSelectionTrackingSupport.Checked = value;
			}
		}

		private void chkSubscribeToWindowFrameEvents_CheckedChanged(object sender, EventArgs e)
		{
			DictionaryService.SetValue("SubscribeToWindowFrameEvents", chkSubscribeToWindowFrameEvents.Checked);
		}

		private void chkSelectionTrackingSupport_CheckedChanged(object sender, EventArgs e)
		{
			DictionaryService.SetValue("SelectionTrackingSupport", chkSelectionTrackingSupport.Checked);
		}
	}
}